//
//  CameraHollowView.m
//  ZITHER
//
//  Created by imac on 2018/1/30.
//  Copyright © 2018年 MS1968. All rights reserved.
//

#import "CameraHollowView.h"

@implementation CameraHollowView


- (void)drawRect:(CGRect)rect {
//    [self layoutIfNeeded];
    UIBezierPath *path = [UIBezierPath bezierPathWithRect:rect];
    CGRect hollowRect = _hollowRect;

    UIBezierPath *circlePath = [UIBezierPath bezierPathWithRect:hollowRect];
    [path appendPath:circlePath];
    [path setUsesEvenOddFillRule:YES];
    
    CAShapeLayer *fillLayer = [CAShapeLayer layer];
    fillLayer.path = path.CGPath;
    fillLayer.fillRule = kCAFillRuleEvenOdd;
//    fillLayer.fillColor = [[UIColor blackColor] colorWithAlphaComponent:0.6].CGColor;
    
    fillLayer.fillColor = [UIColor clearColor].CGColor;
    
//    fillLayer.opacity = 0.6f;
    [self.layer addSublayer:fillLayer];
    
}
@end
